﻿#pragma once

#include <QWidget>

#include "svgshape.h"
#include "svglineinfowidget.h"
#include "svgcanvasinfowidget.h"

class QLabel;
class SvgShape;
class SvgCanvas;
class QFormLayout;
class QPushButton;
class QLineEdit;
class QStackedLayout;

class SvgExtraInfoWidget : public QWidget, public ShapeVisitor<void>
{
	Q_OBJECT
public:
	explicit SvgExtraInfoWidget(QWidget* parent);

public slots:
	void ShowCanvasData(const SvgCanvas& canvas) const;
	void ShowShapesData(vector<SvgShape*>& shapes);

protected:
	void _VisitLine(SvgLine& line) override;
	void _VisitRect(SvgRect& rect) override;
	void _VisitEllipse(SvgEllipse& ellipse) override;
	void _VisitPolygon(SvgPolygon& polygon) override;
	void _VisitText(SvgText& text) override;
	void _VisitPath(SvgPath& path) override;

private:
	void _ShowMultiShapeData(vector<SvgShape*>& shapes);

public:
	SvgLineInfoWidget* lineInfoWidget;
	SvgCanvasInfoWidget* canvasInfoWidget;

private:
	QStackedLayout* m_stackLayout = nullptr;
	QLabel* m_todoLabel;
};
